﻿@using PagedList;
@using PagedList;
@using PagedList.Mvc

@model IPagedList<SILAS.Entidades.Visita>

@{
    ViewBag.Title = "ListarVisitas";
    Layout = "~/Views/Shared/_LayoutGeneral.cshtml";
}
@section css{

<link href="@Url.Content("~/Content/PagedList.css")" rel="stylesheet" type="text/css" />

}




<h2>ListarVisitas</h2>

<p>
    @Html.ActionLink("Crear Nuevo", "Create")
</p>
<table>
<tr>
    <td>
            <table>
                <tr>
                    
                    <th>
                        Fecha
                    </th>
                    <th>
                        Observaciones
                    </th>
                    <th>
                        Acuerdos
                    </th>
                    <th>
                        IdSector
                    </th>
        
                    <th></th>
                </tr>

            @foreach (var item in Model) {
                <tr>
                   
                    <td>
                        @Html.DisplayFor(modelItem => item.Fecha)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Observaciones)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Acuerdos)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.IdSector)
                    </td>
                    
        
        <td>
            @* id=item.PrimaryKey *@
            <center>
            <a href="@Url.Action("Edit", "Visita", new { id = item.Id })">
               <img src="@Url.Content("~/Content/Imagenes/edit.png")" title="Editar Visita" alt="Editar Visita" />
            </a>

             @* @Html.ActionLink("Edit", "Edit", new { id = item.Id }) *@

              <a href="@Url.Action("Delete", "Visita", new { id = item.Id})" onClick = "return confirm('¿Está seguro de querer eliminar visita?');" class = "deleteLink">
               <img src="@Url.Content("~/Content/Imagenes/delete.png")" title="Eliminar Visita" alt="Eliminar Visita" />
              </a>

             @* @Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { onClick = "return confirm('¿Está seguro de querer eliminar este ciudadano?');" })*@

              <a href="@Url.Action("Details", "Visita", new { id = item.Id})">
               <img src="@Url.Content("~/Content/Imagenes/detalle.png")" title="Ver Detalles Visita" alt="Ver Detalles Visita" />
              </a>

             @* @Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { onClick = "return confirm('¿Está seguro de querer eliminar este ciudadano?');" })*@

            </center>
        </td>
         
                </tr>
    
            }

            </table>

    </td>
               
   
</tr>

</table>

<div>
    @Html.PagedListPager(Model, page => Url.Action("ListarCiudadanos", new { page })) 
</div>

